#ifndef AVPACKET_LIST
#define AVPACKET_LIST

#include "codec.h"
#include <iostream>
extern "C"
{
#include <libavcodec/avcodec.h>
}
namespace lcf
{
    class AVPacketList
    {
    public:
        AVPacketList() : maxPackets_(1000) {}
        ~AVPacketList() {}
        AVPacket *Pop();
        void Push(AVPacket *pkt);
        int Size();
        void Clear();

    private:
        std::list<AVPacket *> pkts_;

        int maxPackets_; // 最大列表数量，超出清理
        std::mutex mtx_;
    };
}

#endif